<?php
/**
 * udalost_sabl View for Ohlasky Component
 * @license		GNU/GPL
 */

// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

jimport( 'joomla.application.component.view' );

/**
 * udalost_sabl View
 *
 */
class OhlaskysViewUdalost_sabl extends JView {
/**
 * display method of udalost_sabl view
 * @return void
 **/
    function display($tpl = null) {
    //get the udalost_sabl
        $udalost_sabl =& $this->get('Data');
        $isNew	= ($udalost_sabl->id < 1);
        $text = '';
        $sablona_nazev = '';
        if (!empty($udalost_sabl)) {
            $jeToNova_ohl_bool = true;
            if (!empty($udalost_sabl->id)) {
                $jeToNova_ohl_bool = false;
            }
            if (!empty($udalost_sabl->sablona_nazev)) {
                $sablona_nazev = $udalost_sabl->sablona_nazev;
            }
            if (!empty($udalost_sabl->misto_nazev)) {
                $text = ' místo: '.$udalost_sabl->misto_nazev;
            }
            if (!empty($udalost_sabl->den_tydne)) {
                $text = $text.', den: '.$udalost_sabl->den_tydne;
            }
        }
        
        JToolBarHelper::title(   JText::_('Událost šablony ').$sablona_nazev.' <small><small>['.$text.']</small></small>' );
        JToolBarHelper::save();
        if ($isNew) {
            JToolBarHelper::cancel();
        } else {
        // for existing items the button is renamed `close`
            JToolBarHelper::deleteList();
            JToolBarHelper::cancel( 'cancel', 'Close' );
        }

        $this->assignRef('udalost_sabl',	$udalost_sabl);

        parent::display($tpl);
    }
}

